<template>
<view class='toast' v-show='hidde'>
    <view class='toast-cont'>
        {{text}}
    </view>
</view>
</template>
<script>
import Taro from '@tarojs/taro';
// import './toast.less'
import { reactive, ref, toRefs } from '@vue/runtime-core';
export default {
name:'toast',
setup(props,{ attrs, slots, emit }){
    const state = reactive({
        hidde:false,
        text:'',
        time:1000,
    })

    const show = (text,time)=>{
        state.hidde = true
        state.text = text
        time = time || state.time
        setTimeout(()=>{
            this.hidde = false
        },time)
    }

    return {
        ...toRefs(state)
    }

},
}
</script>

<style scoped>

</style>